package com.tensai.study.问题.解决的问题.OOM.Test;

import java.util.HashMap;
import java.util.Map;

public class Test {

	private static int count = 0;

	public static void main(String[] args) {
		test();
		fei(500000);
		Map<String, String> map = new HashMap() {{
			put("map1", "value1");
			put("map2", "value2");
			put("map3", "value3");
		}};
	}

	static int fei(int n) {
		if (n == 1 || n == 2) {
			return 1;
		}
		return fei(n - 1) + fei(n - 2);
	}

	static public void recursiveCalls(String a) {
		count++;
		System.out.println("stack depth: " + count);
		recursiveCalls(a);
	}

	static public void test() {
		try {
			recursiveCalls("a");
		} catch (Exception e) {
			System.out.println(e);
		}
	}
}
